package org.test.client.ui.content.uifeature;

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JPanel;

import org.test.client.ui.component.btn.MyUIButton;
import org.test.client.ui.util.CompFactory;
import org.test.client.ui.util.VFlowLayout;

public class ButtonPanel extends JPanel{
	
	JPanel jPanel = null;
	
	public ButtonPanel(){
		initUI();
	}
		
	
	public void initUI(){
		jPanel = new JPanel(new VFlowLayout());
		
		JPanel bluePanel = new JPanel();
		//blue
		bluePanel.add(new MyUIButton("这是一个按钮").doInit());
		bluePanel.add(new MyUIButton("fa-plus","按钮","fa-plus").doInit());
		bluePanel.add(new MyUIButton("fa-plus","按钮",null).doInit());
		bluePanel.add(new MyUIButton(null,"按钮","fa-plus").doInit());
		bluePanel.add(new MyUIButton(null,null,"fa-plus").doInit());
		
		JPanel redPanel = new JPanel();
		//red
		redPanel.add(CompFactory.createRedBtn(null, "这是一个按钮", null));
		redPanel.add(CompFactory.createRedBtn("fa-plus","按钮","fa-plus"));
		redPanel.add(CompFactory.createRedBtn("fa-plus","按钮",null));
		redPanel.add(CompFactory.createRedBtn(null,"按钮","fa-plus"));
		redPanel.add(CompFactory.createRedBtn(null,null,"fa-plus"));
		
		JPanel greenPanel = new JPanel();
		//green
		greenPanel.add(CompFactory.createGreenBtn(null, "这是一个按钮", null));
		greenPanel.add(CompFactory.createGreenBtn("fa-plus","按钮","fa-plus"));
		greenPanel.add(CompFactory.createGreenBtn("fa-plus","按钮",null));
		greenPanel.add(CompFactory.createGreenBtn(null,"按钮","fa-plus"));
		greenPanel.add(CompFactory.createGreenBtn(null,null,"fa-plus"));
		
		JPanel orangePanel = new JPanel();
		//orange
		orangePanel.add(CompFactory.createOrangeBtn(null, "这是一个按钮", null));
		orangePanel.add(CompFactory.createOrangeBtn("fa-plus","按钮","fa-plus"));
		orangePanel.add(CompFactory.createOrangeBtn("fa-plus","按钮",null));
		orangePanel.add(CompFactory.createOrangeBtn(null,"按钮","fa-plus"));
		orangePanel.add(CompFactory.createOrangeBtn(null,null,"fa-plus"));
		
		JPanel deepBluePanel = new JPanel();
		//deepBlue
		deepBluePanel.add(CompFactory.createDeepBlueBtn(null, "这是一个按钮", null));
		deepBluePanel.add(CompFactory.createDeepBlueBtn("fa-plus","按钮","fa-plus"));
		deepBluePanel.add(CompFactory.createDeepBlueBtn("fa-plus","按钮",null));
		deepBluePanel.add(CompFactory.createDeepBlueBtn(null,"按钮","fa-plus"));
		deepBluePanel.add(CompFactory.createDeepBlueBtn(null,null,"fa-plus"));
		
		jPanel.setPreferredSize(new Dimension(450,350));
		jPanel.add(bluePanel);
		jPanel.add(redPanel);
		jPanel.add(greenPanel);
		jPanel.add(orangePanel);
		jPanel.add(deepBluePanel);
		
		
		JPanel panel2 = new JPanel();
		panel2.setLayout(null);
		MyUIButton top1 = CompFactory.createDeepBlueBtn(null, "这是一个按钮", null);
		MyUIButton top2 = CompFactory.createDeepBlueBtn("fa-plus","按钮","fa-plus");
		panel2.add(top1);
		panel2.add(top2);
		top1.setBounds(10, 10, 100, 80);
		top2.setBounds(150, 10, 250, 50);
		panel2.setPreferredSize(new Dimension(0,150));
		
		
		this.setLayout(new VFlowLayout(5));
		this.add(jPanel);
		this.add(panel2);
	}
	
}
